package orsettomelee;

import java.awt.geom.Point2D;
import java.util.List;
import java.util.Vector;

import orsettomelee.utils.Wave;


class Enemy {
	/*
	 * ok, we should really be using accessors and mutators here, (i.e getName()
	 * and setName()) but life's too short.
	 */
	private String name;
	private double bearing, heading, speed, distance, changehead;
	private long ctime; // game time that the scan was produced
	private boolean live; // is the enemy alive?
	private double energy;
	private int direction;
	
	public List<Wave> waves = new Vector<>();
	public double STAT[]=new double[Constants.numSliceGF];
	
	private Point2D.Double position;

	@Override
	public String toString() {
		return "Enemy [name=" + name + ", distance=" + distance + ", energy=" + energy + ", position=" + position + "]";
	}

	public Point2D.Double getPosition() {
		return position;
	}

	public void setPosition(Point2D.Double position) {
		this.position = position;
	}

	public double getEnergy() {
		return energy;
	}

	public void setEnergy(double energy) {
		this.energy = energy;
	}

	// Given velocity, initial velocity and time calculate the acceleration.
	// a = (v - v0)/t
	public static double returnAcceleration(double oldVelocity, double currVelocity, double deltaTime) {
		return (currVelocity - oldVelocity) / deltaTime;
	}

	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}

	public double getBearing() {
		return bearing;
	}

	public void setBearing(double bearing) {
		this.bearing = bearing;
	}

	public double getHeading() {
		return heading;
	}

	public void setHeading(double heading) {
		this.heading = heading;
	}

	public double getSpeed() {
		return speed;
	}

	public void setSpeed(double speed) {
		this.speed = speed;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public double getChangehead() {
		return changehead;
	}

	public void setChangehead(double changehead) {
		this.changehead = changehead;
	}

	public long getCtime() {
		return ctime;
	}

	public void setCtime(long ctime) {
		this.ctime = ctime;
	}

	public boolean isLive() {
		return live;
	}

	public void setLive(boolean live) {
		this.live = live;
	}
	
	public int getDirection() {
		return direction;
	}

	public void setDirection(int direction) {
		this.direction = direction;
	}

}